#ifndef OVERVIEWWINDOW_H
#define OVERVIEWWINDOW_H

#include <QFrame>
#include <QDateTime>
#include <QTimer>
#include <QString>
#include <QPainter>

namespace Ui {
class OverviewWindow;
}

class OverviewWindow : public QFrame
{
    Q_OBJECT

public:
    explicit OverviewWindow(QDateTime time, QWidget *parent = nullptr);
    ~OverviewWindow();

signals:
    void closeThis();

protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void paintEvent(QPaintEvent *event)
    {
        QPainter painter(this);
            painter.setRenderHint(QPainter::Antialiasing);
            painter.setBrush(QBrush(QColor(75, 75, 75)));
            painter.setPen(Qt::transparent);
            QRect rect = this->rect();
            rect.setWidth(rect.width() - 1);
            rect.setHeight(rect.height() - 1);
            painter.drawRoundedRect(rect, 8, 8);
            QWidget::paintEvent(event);
    }

private slots:
    void on_pushButton_close_clicked();

private:
    Ui::OverviewWindow *ui;
    QDateTime startRunTime;
    QTimer mTime;
    bool isPress;
    QPoint pressPos;
};

#endif // OVERVIEWWINDOW_H
